<?php
	$funcao = 'pow($x,2) - pow($y,2)';
	$ex[0] = 0;
	$ey[0] = 0;
	$int1 = 0;
	$int2 = 1;
	$h = 0.1;
	
	$output = "";
	$output.="\n<p>y' = ".$funcao."</p>";
	$output.="\n<p>y(".$ex[0].") = ".$ey[0]."</p>";
	$output.="\n<p>Intervalo: [$int1,$int2]";
	$output.="\n<p>h=$h</p>";

	$x = $ex[0];
	$x = $ey[0];
	$eval = "\$result = $funcao;";

	echo $output;

	echo "\n<p>y(".$ex[0].") = ".$ey[0]."</p>";
	for ($i = 0; $i < ($int2-$int1)/$h; $i++)
	{
		$x = $ex[$i];
		$y = $ey[$i];
		eval($eval);
		$ey[$i+1] = $ey[$i] + $h * $result;
		$ex[$i+1] = ($h * ($i+1)) + $int1;
		echo "\n<p>y(".$ex[$i+1].") = ".$ey[$i+1]."</p>";
	}
?>